<?php
$page=intval($_GET["page"]);
$playid=$_GET["playid"];
$userid=$_COOKIE[uid];
$sz="where id='1'";
$shezhi=queryall(se2wz,$sz);
$iseveryday=$shezhi[iseveryday];
$apache=$shezhi[apache];
$pull=$shezhi[pull];

if ($playid)
{
    if (empty($userid))
    {
        echo msglayerurl("请登录！",8,"/user/login.php");die;
    }
    $rfr=$_SERVER['HTTP_REFERER'];//来源
    $isrfr=substr_count($rfr,'?');
    $ispage1=substr_count($rfr,'&page');
    $ispage2=substr_count($rfr,'?page');
    if ($ispage1==1)
    {
    $current=$rfr."#";
    preg_match('/page=(.*?)#/',$current,$result);
    $thnr=$result[1];
    $rfr=str_replace("&page=".$thnr,"",$rfr);
    }elseif ($ispage2==1){
    $current=$rfr."#";
    preg_match('/page=(.*?)#/',$current,$result);
    $thnr=$result[1];
    $rfr=str_replace("?page=".$thnr,"",$rfr);
    }
    if ($isrfr==1 && $ispage1==0 && $ispage2==1 )
    {
    $rfr=$rfr."?page=".$page;
    }
    elseif ($ispage2==1)
    {
    $rfr=$rfr."&page=".$page;
    }
    elseif ($isrfr==1)
    {
    $rfr=$rfr."&page=".$page;
    }
    else
    {
    $rfr=$rfr."?page=".$page;
    }
    setcookie("ulr",$rfr,time()+3600*24,"/");
    $sk=$shezhi[sk];
    $youke=$shezhi[youke];
    $pthy=$shezhi[pthy];
    $viphy=$shezhi[viphy];
    header('Location: '.$play.'?playid='.$playid.'&ly=ubosk');
    exit;
}

?>